Salesforce UX API icon

Salesforce UX API

(0 reviews)

TMF622 PATCH - Create Recuring Service Credit

This API is used to apply the service credit/Promotions on products in Aria System

The promotions are applied as recurring discounts on the invoice For specific plan + handset combinations there are Promotions on Installments that can be applied

Note:

  • To work this functionality the value of "description" field should be "AdvancedServiceCredits", in request payload.
  • The value of "action” under "productOrderItem" should be “noChange” at Master Plan level. And can be “modify/noChange” at supplement-plan level.
  • If "productOrderItem.action" is "modify" then ESB will pass this service-credit request to Aria else ignore.
  • The service credits are applied as recuring on a product or multiple products ( ESB API will support up to 4 level hierarchy based on productOrderItem ).​

URL

https://[localhost]:[port]/sfdc-ux/v1/{businessId}/productOrder/{id}

URL PARAM

nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit. Expected one is "PR"-Puerto RicoY
idstringUnique Identifier of the Product OrderY
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel.Y
client_secretstringPassword associated with the client_id.Y
X-Correlation-IDstringAn identifier for the current call chain that can be used to tie together log entries on multiple layers (e.g. client, server, mainframe). This identifier must be designed to be unique across all applications.N
targetSystemstringTo identify the target BSS. Example: AriaY
channeIdstringChannel to business. Eg: "SFDC-B2C"Y

Request

Service-Credit/Promotion on Supplement-Plan Level
{
    "billingAccount": {
        "id": "ban0524230-can0524230",
        "@type": "AccountRef"
    },
    "@type": "ProductOrder",
    "description": "AdvancedServiceCredits",
    "productOrderItem": [
        {
            "id": "0001",
            "action": "noChange",
            "@type": "AccountPlan",
            "quantity": 1,
            "product": {
                "id": "ban0524230-can0524230_MPI_000",
                "name": "Account_Master_Plan"
            },
            "productOrderItem": [
                {
                    "id": "0001",
                    "action": "modify",
                    "@type": "SupplementPlan",
                    "quantity": 1,
                    "product": {
                        "id": "ban0524230-can0524230_110",
                        "name": "LLA_General_Device",
                        "description": "Installment|160000048018107",
                        "productCharacteristic": [
                            {
                                "name": "Credit Details",
                                "valueType": "object",
                                "value": {
                                    "reasonCode": "1",
                                    "frequency": "36",
                                    "frequencyIntervalType": "1",
                                    "frequencyIntervalLength": "1",
                                    "initialDate": "2024-12-02",
                                    "serviceCodeOption": "2",
                                    "altCallerId": "CreateRecCredit"
                                }
                            }
                        ]
                    },
                    "itemPrice": [
                        {
                            "name": "LLA_General_Device",
                            "@type": "custom_rates",
                            "price": {
                                "dutyFreeAmount": {
                                    "unit": "USD",
                                    "value": 23.99
                                }
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
Service Credit/Promotion on multiple Supplement-Plan Level
{
    "billingAccount": {
        "id": "ban0524230-can0524230",
        "@type": "AccountRef"
    },
    "@type": "ProductOrder",
    "description": "AdvancedServiceCredits",
    "productOrderItem": [
        {
            "id": "0001",
            "action": "noChange",
            "@type": "AccountPlan",
            "quantity": 1,
            "product": {
                "id": "ban0524230-can0524230_MPI_000",
                "name": "Account_Master_Plan"
            },
            "productOrderItem": [
                {
                    "id": "0002",
                    "action": "noChange",
                    "@type": "SupplementPlan",
                    "quantity": 1,
                    "product": {
                        "id": "ban0524230-can0524230_100",
                        "name": "PR_B2C_Unlimited_50_Plus"
                    },
                    "productOrderItem": [
                        {
                            "id": "0003",
                            "action": "modify",
                            "@type": "SupplementPlan",
                            "quantity": 1,
                            "product": {
                                "id": "ban0524230-can0524230_110",
                                "name": "PR_B2C_ULT_50_Plus_MB_Line",
                                "description": "Service credit for Admin Fee",
                                "productCharacteristic": [
                                    {
                                        "name": "Credit Details",
                                        "valueType": "object",
                                        "value": {
                                            "reasonCode": "1",
                                            "frequency": "1",
                                            "frequencyIntervalType": "1",
                                            "frequencyIntervalLength": "1",
                                            "initialDate": "2023-05-06",
                                            "serviceCodeOption":"2",
                                            "altCallerId": "CreateRecCredit"
                                        }
                                    }
                                ]
                            },
                            "itemPrice": [
                                {
                                    "name": "PR_B2C_Mobile_Admin_Fee_Voice",
                                    "@type": "custom_rates",
                                    "price": {
                                        "dutyFreeAmount": {
                                            "unit": "USD",
                                            "value": 1.99
                                        }
                                    }
                                }
                            ],
                            "productOrderItem": [
                                {
                                    "id": "0006",
                                    "action": "modify",
                                    "@type": "SupplementPlan",
                                    "quantity": 1,
                                    "product": {
                                        "id": "ban0524230-can0524230_113",
                                        "name": "LLA_General_Device",
                                        "description": "Installment|160000048018107",
                                        "productCharacteristic": [
                                            {
                                                "name": "Credit Details",
                                                "valueType": "object",
                                                "value": {
                                                    "reasonCode": "1",
                                                    "frequency": "1",
                                                    "frequencyIntervalType": "1",
                                                    "frequencyIntervalLength": "1",
                                                    "initialDate": "2023-05-06",
                                                    "serviceCodeOption":"2",
                                                    "altCallerId":"CreateRecCredit"
                                                }
                                            }
                                        ]
                                    },
                                    "itemPrice": [
                                        {
                                            "name": "LLA_General_Device",
                                            "@type": "custom_rates",
                                            "price": {
                                                "dutyFreeAmount": {
                                                    "unit": "USD",
                                                    "value": 27.78
                                                }
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
Definitions
NametypeDescriptionrequired
billingAccountobjectBillingAccount reference.Y
billingAccount.idstringBAN-CAN number ( Client-defined account identifier )Y
billingAccount.@typestringAccount ReferenceN
descriptionstringA type of order which can be used to place an order.
Note - The value must be "AdvancedServiceCredits" always to work this functionality.
Y
productOrderItemarrayA list of Product order itemsY
productOrderItem.idstringUnique identifier of a product line itemY
productOrderItem.actionstringExpected valued is "noChange" always.Y
productOrderItem.@typestringRepresents the plan type of the order line itemN
productOrderItem.quantitynumberRepresents the product line items quantityN
productOrderItem.productobjectProduct line details of Master PlanY
productOrderItem.product.idstringRepresents the product order salesforce instance idY
productOrderItem.product.namestringRepresents the product catalog id for master planN
productOrderItem.productOrderItemarrayThis object is generated for any underlying supplement/child plan of the Master plan objectY
productOrderItem.productOrderItem. idstringY
productOrderItem.productOrderItem. actionstringExpected values either "noChange" or "modify"
If action is “noChange” then ESB will ignor the service credit in Aria
If action is “modify” then ESB will pass this service-credit request to Aria.
Y
productOrderItem.productOrderItem. @typestringRepresents the plan type of the order line itemN
productOrderItem.productOrderItem. quantitystringRepresents the product line items quantityN
productOrderItem.productOrderItem. productobjectProduct line details of supplement planY
productOrderItem.productOrderItem. product.idstringClient-defined unique eligible plan IDs.Y
productOrderItem.productOrderItem. product.namestringRepresents the product catalog id for supplement planY
productOrderItem.productOrderItem. product.productCharacteristicarrayProduct Characteristic that go to the plan instance field or non-subscription offer in Aria mapping
Please refer the characteristics table below for more info. This object is populated for "@type" Supplement-Plan
Y
productOrderItem.productOrderItem. product.productCharacteristic.namestringRepresents the name of the CharacteristicY
productOrderItem.productOrderItem. product.productCharacteristic.valueTypestringRepresents the value data type.N
productOrderItem.productOrderItem. product.productCharacteristic.valueobjectThe value of the CharacteristicY
productOrderItem.productOrderItem. itemPricearrayThis include service credit details.Y
productOrderItem.productOrderItem. itemPrice.namestringClient-defined unique eligible service id in Aria.
Applicable if "@type" is SupplementPlan
Eg:PR_B2C_Mobile_Admin_Fee_Voice, LLA_General_Device, etc.
Y
productOrderItem.productOrderItem. itemPrice.@typestringThe item price type
The "itemPrice.@type" value should be "custom_rates" , else ESB API will ignore this price info to Aria
N
productOrderItem.productOrderItem. itemPrice.priceobjectThis include service credit fee details.Y
productOrderItem.productOrderItem. itemPrice.price.dutyFreeAmountobjectA MoneyY
productOrderItem.productOrderItem. itemPrice.price.dutyFreeAmount.valuenumberThe amount of service credit to create on the accountY
productOrderItem.productOrderItem. itemPrice.price.dutyFreeAmount.unitstringCurrency (ISO4217 norm uses 3 letters to define the currency)N
productOrderItem.productOrderItem. productOrderItemarrayThis object is generated for any underlying supplement/child plan of the supplement plan object, Mappings are defined aboveN
productOrderItem.productOrderItem. productOrderItem.productOrderItemarrayThis object is generated for any underlying supplement/child plan of the sub-supplement plan object, Mappings are defined aboveN
@typestringType of the OrderN

Characteristics Values:

NametypeDescriptionrequired
reasonCodestringThe reason a given credit was/is to be applied to the account.
Allowable values for reason_code:
The below are the allowable values as per Aria
Values Description
1 General Credit/Other
2 Inadequate Service Delivery
3 Billing / Pricing Issue
4 Service no longer desired
5 Customer Dissatisfaction
6 Installation Issue
9 Customer Return
11 System Testing
Y
frequencystringNumber of times the service credit should be applied to the accountN
frequencyIntervalTypestringThe unit of time associated with the frequency.
The below are the allowable values as per Aria
Values Description
1 Monthly
2 Bi-monthly
3 Quarterly
4 Semi-annually
5 Annually
6 Weekly
7 Daily
N
frequencyIntervalLengthstringDefines the duration between credits. Example: If you pass 4 into this field and 6 (weekly) into the 'frequencyIntervalType' field, then the service credit will be applied every 4 weeks.N
initialDatedatetimeDate on which the recurring service credit should start to be appliedN
serviceCodeOptionstringThe value of this field will define which service will be used as a template for taxation on the service credit that is created.
The below are the allowable values as per Aria
If no value is entered in this field, the universal service will be used unless a value is entered in the alt_service_no_to_apply or client_alt_service_id_to_apply field. Then the referenced service will be used instead.
Values Description
0 Aria's universal service will be used to apply this service credit which excludes taxes.
2 The service associated with this service credit will match the charge line item. This will result in tax handling that matches the original charge.
N
altCallerIdstringvalue will be "CreateRecCredit"N

Response

In this section all the possible data structures received by the client at the moment of responding the method are defined.

Possible response success

This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.

[ 200 ]

OK - PATCH request processed successfully, response body contains an entity corresponding to the requested resource.

Service-Credit/Promotion on Supplement-Plan Level
{
    "status": "completed",
    "billingAccount": {
        "id": "ban0524230-can0524230",
        "@type": "AccountRef"
    },
    "@type": "ProductOrder",
    "description": "AdvancedServiceCredits",
    "productOrderItem": [
        {
            "id": "0001",
            "action": "noChange",
            "@type": "AccountPlan",
            "quantity": 1,
            "product": {
                "id": "ban0524230-can0524230_MPI_000",
                "name": "Account_Master_Plan"
            },
            "productOrderItem": [
                {
                    "id": "0001",
                    "action": "modify",
                    "@type": "SupplementPlan",
                    "quantity": 1,
                    "product": {
                        "id": "ban0524230-can0524230_110",
                        "name": "LLA_General_Device",
                        "description": "Installment|160000048018107",
                        "productCharacteristic": [
                            {
                                "name": "Credit Details",
                                "valueType": "object",
                                "value": {
                                    "reasonCode": "1",
                                    "frequency": "36",
                                    "frequencyIntervalType": "1",
                                    "frequencyIntervalLength": "1",
                                    "initialDate": "2024-12-02",
                                    "serviceCodeOption": "2",
                                    "altCallerId": "CreateRecCredit"
                                }
                            },
                            {
                                "name": "CreditIdInfo",
                                "valueType": "Object",
                                "value": {
                                    "creditId": 123456, // newly added field
                                    "recurringCreditNo": 7893456 // newly added field
                                }
                            }
                        ]
                    },
                    "itemPrice": [
                        {
                            "name": "LLA_General_Device",
                            "@type": "custom_rates",
                            "price": {
                                "dutyFreeAmount": {
                                    "unit": "USD",
                                    "value": 23.99
                                }
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
Service Credit/Promotion on multiple Supplement-Plan Level
{
    "state": "completed",
    "billingAccount": {
        "id": "ban0524230-can0524230",
        "@type": "AccountRef"
    },
    "@type": "ProductOrder",
    "description": "AdvancedServiceCredits",
    "productOrderItem": [
        {
            "id": "0001",
            "action": "noChange",
            "@type": "AccountPlan",
            "quantity": 1,
            "product": {
                "id": "ban0524230-can0524230_MPI_000",
                "name": "Account_Master_Plan"
            },
            "productOrderItem": [
                {
                    "id": "0002",
                    "action": "noChange",
                    "@type": "SupplementPlan",
                    "quantity": 1,
                    "product": {
                        "id": "ban0524230-can0524230_100",
                        "name": "PR_B2C_Unlimited_50_Plus"
                    },
                    "productOrderItem": [
                        {
                            "id": "0003",
                            "action": "modify",
                            "@type": "SupplementPlan",
                            "quantity": 1,
                            "product": {
                                "id": "ban0524230-can0524230_110",
                                "name": "PR_B2C_ULT_50_Plus_MB_Line",
                                "description": "Service credit for Admin Fee",
                                "productCharacteristic": [
                                    {
                                        "name": "Credit Details",
                                        "valueType": "object",
                                        "value": {
                                            "reasonCode": "1",
                                            "frequency": "1",
                                            "frequencyIntervalType": "1",
                                            "frequencyIntervalLength": "1",
                                            "initialDate": "2023-05-06",
                                            "service_code_option": "2",
                                            "altCallerId": "CreateRecCredit"
                                        }
                                    },
                                    {
                                        "name": "CreditIdInfo",
                                        "valueType": "Object",
                                        "value": {
                                            "creditId": 123456, // newly added field
                                            "recurringCreditNo": 7893456 // newly added field
                                        }
                                    }
                                ]
                            },
                            "itemPrice": [
                                {
                                    "name": "PR_B2C_Mobile_Admin_Fee_Voice",
                                    "@type": "custom_rates",
                                    "price": {
                                        "dutyFreeAmount": {
                                            "unit": "USD",
                                            "value": 1.99
                                        }
                                    }
                                }
                            ],
                            "productOrderItem": [
                                {
                                    "id": "0006",
                                    "action": "modify",
                                    "@type": "SupplementPlan",
                                    "quantity": 1,
                                    "product": {
                                        "id": "ban0524230-can0524230_113",
                                        "name": "LLA_General_Device",
                                        "description": "Installment|160000048018107",
                                        "productCharacteristic": [
                                            {
                                                "name": "Credit Details",
                                                "valueType": "object",
                                                "value": {
                                                    "reasonCode": "1",
                                                    "frequency": "1",
                                                    "frequencyIntervalType": "1",
                                                    "frequencyIntervalLength": "1",
                                                    "initialDate": "2023-05-06",
                                                    "service_code_option": "2",
                                                    "altCallerId": "CreateRecCredit"
                                                }
                                            },
                                            {
                                                "name": "CreditIdInfo",
                                                "valueType": "Object",
                                                "value": {
                                                    "creditId": 8943993, // newly added field
                                                    "recurringCreditNo": 8233533 // newly added field
                                                }
                                            }
                                        ]
                                    },
                                    "itemPrice": [
                                        {
                                            "name": "LLA_General_Device",
                                            "@type": "custom_rates",
                                            "price": {
                                                "dutyFreeAmount": {
                                                    "unit": "USD",
                                                    "value": 27.78
                                                }
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
Definiotions
NametypeDescriptionrequired
statestringacknowledge on order creation.N
objectComplete request payload will be return as response along with below few additional fields will be come.N
productOrderItem.product.productCharacteristicarrayProduct Characteristic will contain the credit Id details .N
productOrderItem.product. productCharacteristic.namestringName of the CharacteristicN
productOrderItem.product. productCharacteristic.valueTypestringData type of this CharacteristicN
productOrderItem.product. productCharacteristic.valueobjectValue of the CharacteristicN

Characteristics Values:

Characteristic NametypeDescriptionrequired
creditIdnumberAria-assigned unique identifier of credit IdN
recurringCreditNonumberThe identifier for the recurring credit.N

Possible response error

In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.

[ 400 ]

Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

{
  "errors" : [{
      "code" : 400,
      "message" : "The request is invalid or not properly formed.",
      "description" : "Malformed request syntax, invalid request message framing, or deceptive request routing."
    }]
}
[ 401 ]

Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.

{
  "errors" : [{
      "code" : 401,
      "message" : "The user could not be authenticated for this request.",
      "description" : "The request has not been applied because it lacks valid authentication credentials for the target resource"
    }]
}
[ 403 ]

Forbidden - Indicates that the server understood the request but refuses to fulfill it. If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials.

[ 404 ]

Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

{
  "errors" : [{
      "code" : 404,
      "message" : "APIKIT:NOT_FOUND",
      "description" : "The requested operation failed because a resource associated with the request could not be found."
    }]
}
[ 405 ]

Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

{
    "errors": [{
            "code": 405,
             "message": "APIKIT:METHOD_NOT_ALLOWED",
             "description": "HTTP Method PUT not allowed for : /{businessId}/productOrder/{id}"
        }]
}
[ 500 ]

Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.

{
  "errors" : [{
      "code" : 500,
      "message" : "The request failed due to an internal error.",
      "description": "Internal Server Error"
    }]
}
[ 501 ]

Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.

{
  "errors" : [{
      "code" : 501,
      "message" : "Not implemented",
      "description" : "Operation PATCH /{businessId}/productOrder/{id} for Business Id: xxxx not implemented"
    }]
  }
[ 502]

Bad Gateway - gateway is available but backend service is not. The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

[ 503 ]

Service Unavailable - temporary maintenance of service, try again later. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay will be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response. Note: The existence of the 503 status code does not imply that a server will use it when becoming overloaded. Servers may simply refuse the connection.

    Retry-After: 120

Reviews